package com.ai.wxy.spring.jpa.user.dto;

import com.ai.spring.common.annotation.AddGroup;
import com.ai.spring.common.annotation.EditGroup;
import com.ai.wxy.spring.service.api.dto.ServiceParam;
import com.ai.wxy.spring.service.api.dto.ServiceResult;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 用户信息
 *
 * @author 石头
 * @Date 2019/11/19
 * @Version 1.0
 **/
@Data
public class UserDTO implements ServiceParam {
    @NotNull(groups = EditGroup.class,message = "用户ID不能为空")
    private Long id;
    /**登录账号*/
    @NotBlank(groups = AddGroup.class,message = "用户登录名称不能为空")
    @Pattern(regexp = "(?=[a-zA-Z])(?:[a-z0-9A-Z])[a-z0-9A-Z-|_]{6,}",message = "格式错误【用户名称为字母开头且只能包含字母，数字或是-_,且长度为6~10位】")
    private String username;
    /**真实姓名*/
    private String realname;
    /**密码*/
    private String password;
    /**密码盐*/
    private String salt;
    /**性别(0-默认未知,1-男,2-女)*/
    private Integer sex;
    /**电子邮件*/
    private String email;
    /**电话*/
    private String phone;
}
